+ 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.
11 ответов
+ 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")
+ 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
+ 4
You will have to add condition If number is greater than 100 then print statement
+ 4
How about close the Python course. We do not solve a home work.
+ 3
Yes but how
+ 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;
}
}
}
+ 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!")
+ 2
Yeah its not home work but thanks
+ 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.
+ 1
Okay thank you boss what about when i want it to be level 2? Do i do the same thing or what?
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";
}
}