+ 2

PLEASE HELP

https://code.sololearn.com/cFAZI7sn4hQP/?ref=app So basically every time someone puts in the input a number greater than 100 i want it to say: “Level up” and “you have reached level 1” If the number is bigger than 200 i want it to say, again “Level up” and “you have reached level 2” and so on . If someone could help me it would be excellent. God bless you amen.

4th Jul 2023, 4:38 PM
Adamache Mario
11 Respostas
+ 1
Here is the level system, where the xp required doubles itself each time leveling up n = int(input()) score = 100 level = 0 k = 0 while n >= k: level+=1 k+=score*2 print("You are currently at level",level,"with",k-n,"xp")
5th Jul 2023, 4:55 PM
Dragon RB
Dragon RB - avatar
+ 7
Adamache Mario You did not start any course here. How and where do you learn Python? This will help you: https://code.sololearn.com/c91VL76K0YXC/?ref=app
4th Jul 2023, 5:19 PM
JaScript
JaScript - avatar
+ 4
You will have to add condition If number is greater than 100 then print statement
4th Jul 2023, 4:43 PM
A S Raghuvanshi
A S Raghuvanshi - avatar
+ 4
How about close the Python course. We do not solve a home work.
4th Jul 2023, 4:46 PM
JaScript
JaScript - avatar
+ 3
Yes but how
4th Jul 2023, 4:44 PM
Adamache Mario
+ 3
import java.util.Scanner; public class Program { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int input = sc.nextInt(); int x=input% 100; int y=input/100; while(input>99){ if(input==100 ){ System.out.println("You have reached next level, Level Up"); break; } else if (x==0){ System.out.println("You have reached new level " + y + " Level Up"); } break; } } }
5th Jul 2023, 4:44 PM
Kunal Bumb
Kunal Bumb - avatar
+ 2
U have to learn how to use condition score = int(input()) if score>100: print("If you have more than 100 xp, you leveled up!")
4th Jul 2023, 4:44 PM
A S Raghuvanshi
A S Raghuvanshi - avatar
+ 2
Yeah its not home work but thanks
4th Jul 2023, 4:46 PM
Adamache Mario
+ 2
Hm. I think it's pretty pretty easy! If you want multiple level, try using n/100, where n is the exp(user input as integer or doubles). If you want to return integer value(meaning that it doesnt have the ".0") value, use int() function.
4th Jul 2023, 5:05 PM
Dragon RB
Dragon RB - avatar
+ 1
Okay thank you boss what about when i want it to be level 2? Do i do the same thing or what?
4th Jul 2023, 4:45 PM
Adamache Mario
0
#include<iostream> using namespace std; int main(){ int n; cin>>n; if(n%100==0){ int fd=n/100; cout<<"Level Up & You Have reached level "<<fd; } else{ cout<<"Score More"; } }
6th Jul 2023, 4:16 AM
Ritesh Raj
Ritesh Raj - avatar